package com.woniuxy.ptapp.common.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class CheckCancelTime {

    public static Boolean Check(String ClassTime,String NowTime){

        long cancelTime = 1800000;
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {
            Date parse1 = format.parse(ClassTime);
            Date parse2 = format.parse(NowTime);
            long diff =parse1.getTime()-parse2.getTime();
            if(diff>=cancelTime){
                return true;
            }else {
                return false;
            }
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return false;
    }
}
